Fix get_dummy_wan_inputs for two-expert Wan2.2-I2V-A14B pipeline#427
Fix get_dummy_wan_inputs for two-expert Wan2.2-I2V-A14B pipeline#427ThomasNing wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Perseus14
left a comment
There was a problem hiding this comment.
Thanks for the PR. I have added a comment, PTAL!
|
@Perseus14 Hi Rishabh, could you take another look? |
|
LGTM! Could you please run this linting check? For some reason that test is not being triggered.
If no errors, will approve the PR |
|
Ran it on the branch: Exit 0, no diffs — the two changed files ( |
|
@ThomasNing Looks like one of the email used in the commits of this PR hasn't signed the google cla. Please rebase and squash commits with the right email |
Derive the dummy-input channel count from whichever expert exists on the two-expert I2V-2.2 pipeline (low/high_noise_transformer) instead of the absent single pipeline.transformer, and generate the dummy WAN latents uniformly so quantization calibration works for this pipeline.
6212212 to
952aa1e
Compare
|
@Perseus14 Passed the CLA. |
Problem
get_dummy_wan_inputs(called byWanPipeline.quantize_transformer→qwix.quantize_model) assumes a singlepipeline.transformerand the single-transformerprepare_latents()signature. The two-expertWanPipelineI2V_2_2(Wan2.2-I2V-A14B) haslow_noise_transformer/high_noise_transformer(no.transformer) and a differentprepare_latents()signature, souse_qwix_quantization=Truecrashes:and, once that's worked around:
Fix
When
pipeline.transformeris absent (two-expert pipeline), build the dummy latents directly in the(B, C, F, H, W)layoutWanModel.__call__expects, takingnum_channels_latentsfrom an existing expert (low_noise_transformer). The single-transformer path is unchanged.Validation
On Wan2.2-I2V-A14B (TPU v6e-16, 1080p, 4-step): with this change, quantization proceeds past both errors above into
qwix.quantize_model(the model forward traces correctly with(latents, timesteps, prompt_embeds)). A separate qwix↔JAX version issue (conv_general_dilated() got an unexpected keyword argument 'out_sharding') then surfaces in our environment — unrelated to this change.